package com.ligong.blog.common.util;

import com.ligong.blog.pojo.dataobject.BlogInfo;
import com.ligong.blog.pojo.dataobject.UserInfo;
import com.ligong.blog.pojo.request.AddBlogRequest;
import com.ligong.blog.pojo.response.UserInfoResponse;
import org.springframework.beans.BeanUtils;

public class BeanTransformUtils {
    public static UserInfoResponse trans(UserInfo userInfo) {
        UserInfoResponse userInfoResponse = new UserInfoResponse();
        BeanUtils.copyProperties(userInfo, userInfoResponse);
        return userInfoResponse;
    }

    public static BlogInfo trans(AddBlogRequest addBlogRequest) {
        BlogInfo blogInfo = new BlogInfo();
        BeanUtils.copyProperties(addBlogRequest, blogInfo);
        return blogInfo;
    }


}
